package com.duoduo.common.api.constants;


import com.duoduo.common.api.help.PropertiesInnerUtil;

import java.io.File;
import java.lang.reflect.Type;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class Constant {

	public static final String CHARSET = "utf-8";
	public static final Charset CHARSET_OBJ = Charset.forName(CHARSET);
	public static final String JSON_CONTENTTYPE = "application/json";
	public static final String TEXT_CONTENTTYPE = "text/plain";
	public static final String EQ = "=";
	public static final String QUESTION = "?";
	public static final String SLASH = "/";
	public static final String AND = "&";
	public static final String EMPTY_STRING = "";
	public static final String DOT = ".";
	public static final String COLON = ":";
	public static final String BLANK = " ";
	public static final String LEFT_BRACE = "{";
	public static final String RIGHT_BRACE = "}";
	public static final String COMMA = ",";
	public static final String STAR = "*";
	public static final String MARK = "#";
	public static final String DOLLAR = "$";
	public static final String MEDIAN = "-";
	public static final String UNDERLINE = "_";
	public static final String TRUE = "true";
	public static final String FALSE = "false";
	public static final String ZERO = "0";

	// SPI加载类信息
	public static final String BEANOPT_TYPE = "beanoptType";
	public static final String BEANOPT_TYPE_DEFAULT = "javassist";
	public static final String JSON_TYPE = "jsonType";
	public static final String JSON_TYPE_DEFAULT = "jackson";
	public static final String EXCEL_TYPE = "excelType";
	public static final String EXCEL_TYPE_DEFAULT = "poi";
	public static final String WORKID_TYPE = "workIdType";
	public static final String WORKID_TYPE_DEFAULT = "zookeeper";
	public static final String SERIALIZATION_TYPE = "serializationType";
	public static final String SERIALIZATION_TYPE_DEFAULT = "hessian";
	public static final String LOCK_TYPE = "lockType";
	public static final String LOCK_TYPE_DEFAULT = "redis";
	public static final String LEADER_TYPE = "leaderType";
	public static final String LEADER_TYPE_DEFAULT = "zookeeper";
	public static final String CACHE_TYPE = "cacheType";
	public static final String CACHE_TYPE_DEFAULT = "redis";
	public static final String REDIS_IMPL = "redisImpl";
	public static final String REDIS_IMPL_DEFAULT = "jedis";
	public static final String ZOOKEEPER_IMPL = "zookeeperImpl";
	public static final String ZOOKEEPER_IMPL_DEFAULT = "curator";
	public static final String MQ_TYPE = "mqType";
	public static final String MQ_TYPE_DEFAULT = "rabbit";
	public static final String RABBIT_IMPL = "rabbitImpl";
	public static final String RABBIT_IMPL_DEFAULT = "rabbit3_6";
	public static final String KAFKA_IMPL = "kafkaImpl";
	public static final String KAFKA_IMPL_DEFAULT = "kafka2_1_0";
	public static final String ROCKET_IMPL = "rocketImpl";
	public static final String ROCKET_IMPL_DEFAULT = "rocket4_7_1";
	public static final String METHOD_DISPATCH_IMPL = "methoddispatch";
	public static final String ES_IMPL = "esImpl";
	public static final String ES_IMPL_DEFAULT = "es6";
	public static final String MONGO_IMPL = "mongoImpl";
	public static final String MONGO_IMPL_DEFAULT = "springMongo2";
	public static final String WORKFLOW_IMPL = "workflowImpl";
	public static final String WORKFLOW_IMPL_DEFAULT = "activiti";
	public static final String CONFIGCENTER_IMPL = "configCenterImpl";
	public static final String CONFIGCENTER_IMPL_DEFAULT = "apollo";
	public static final String TASK_IMPL = "taskImpl";
	public static final String TASK_IMPL_DEFAULT = "sia";
	public static final String CONCURRENT_IMPL_VALUE = "completableFuture";
	public static final String ENCRYPT_TYPE = "encryptType";
	public static final String ENCRYPT_TYPE_DEFAULT = "aes";
	public static final String REST_TYPE = "restType";
	public static final String REST_TYPE_DEFAULT = "okhttp";
	public static final String CONSISTENCY_RETRY_IMPL = "consistencyRetryImpl";
	public static final String CONSISTENCY_RETRY_IMPL_DEFAULT = "simple";
	public static final String CONCURRENT_REFERENCE_MAP_DEFAULT = "optimize";

	public static final String duoduo_COM_PREFIX = "com.duoduo.";
	public static final String duoduo_ORG_PREFIX = "org.duoduo.";

	//rabbit配置信息
	public static final String RABBIT_PROP_LOCATION = "rabbit.properties";
	public static final String RABBIT_PROP_NAMES = "rabbit.names";
	public static final String RABBIT_PROP_DEFAULT_NAME = "default"; // 默认的rabbitmq配置name
	public static final String MQ_PROP_DEFAULT_CONFIGNAME = "default"; // 默认的mq配置名
	public static final String MQ_PROP_DEFAULT_GROUPNAME = "defaultgroup"; // 默认的groupid
	public static final String MQ_PROP_DEFAULT_TOPIC = "defaulttopic"; // 默认的topic
	public static final String RABBIT_PROP_SERVER = "rabbit.server";
	public static final String RABBIT_PROP_SERVER_PORT = "rabbit.server.port";
	public static final String RABBIT_PROP_SERVER_VIRTUALHOST = "rabbit.server.virtualHost";
	public static final String RABBIT_PROP_SERVER_USERNAME = "rabbit.server.username";
	public static final String RABBIT_PROP_SERVER_PASSWORD = "rabbit.server.password";
	public static final String RABBIT_PROP_SERVER_AUTO_RECOVERY = "rabbit.server.automatic_recovery_enabled";
	public static final String RABBIT_PROP_SERVER_AUTO_DECLARE = "rabbit.server.automatic_declare_enabled"; // 是否可以自动创建主题
	public static final boolean RABBIT_PROP_SERVER_AUTO_RECOVERY_DEFAULT = true; // rabbit.server.automatic_recovery_enabled的默认值
	public static final boolean RABBIT_PROP_SERVER_AUTO_DECLARE_DEFAULT = true; // rabbit.server.automatic_declare_enabled的默认值
	public static final String RABBIT_PROP_EXCHANGE_PREFIX = "rabbit.exhange.prefix"; // exhange前缀
	public static final String RABBIT_PROP_QUEUE_PREFIX = "rabbit.queue.prefix"; // queue前缀
	// kafka配置
	public static final String KAFKA_PROP_LOCATION = "kafka.properties";
	public static final String KAFKA_PROP_ENV = "env";
	public static final String KAFKA_PROP_NAMES = "kafka.names";
	public static final String KAFKA_PROP_DEFAULT_NAME = "default"; // 默认的kafka配置name
	public static final String KAFKA_PROP_SERVER = "bootstrap.servers";
	public static final String KAFKA_PROP_MAX_POLL_INTERVAL_MS = "consumer.max.poll.interval.ms";
	public static final int KAFKA_PROP_MAX_POLL_INTERVAL_MS_DEFAULT = 5000;
	public static final String KAFKA_PROP_MAX_POLL_RECORDS = "consumer.max.poll.records";
	public static final String KAFKA_KEY_DESER = "org.apache.kafka.common.serialization.StringDeserializer";
	public static final String DEFAULT_KAFKA_VALUE_DESER = "org.duoduo.common.kafka.plugins.KafkaDeserializer";
	public static final String DEFAULT_KAFKA_KEY_DESER = "org.apache.kafka.common.serialization.StringDeserializer";
	public static final String DEFAULT_KAFKA_VALUE_SER = "org.duoduo.common.kafka.plugins.KafkaSerializer";
	public static final String DEFAULT_KAFKA_KEY_SER = "org.apache.kafka.common.serialization.StringSerializer";
	//rocket配置信息
	public static final String ROCKET_PROP_LOCATION = "rocket.properties";
	public static final String ROCKET_PROP_NAMES = "rocket.names";
	public static final String ROCKET_PROP_DEFAULT_NAME = "default"; // 默认的rocketmq配置name
	public static final String ROCKET_PROP_SERVER = "namesrv";
	
	//redis配置信息
	public static final String REDIS_PROP_LOCATION = "redis.properties";
	public static final String REDIS_PROP_NAMES = "redis.names";
	public static final String REDIS_PROP_DEFAULT_PRE_NAME = "default"; // 默认的redis配置name
	public static final String REDIS_PROP_CLUSTER_TYPE = "redis.clusterType";
	public static final String REDIS_PROP_CLUSTER_TYPE_DEFAULT = "sentinel"; // redis.clusterType的默认值
	public static final String REDIS_PROP_SERVER = "redis.server";
	public static final String REDIS_PROP_SERVER_COMPATIBILITY = "redis.sentinel.server"; // 用于解决和老配置文件的兼容性问题
	public static final String REDIS_PROP_PASSWORD = "redis.password";
	public static final String REDIS_PROP_DATABASE = "redis.databases";
	public static final int REDIS_PROP_DATABASE_DEFAULT = 4; // redis.databases的默认值
	public static final String REDIS_PROP_MASTERNAME = "redis.sentinel.masterName";
	public static final String REDIS_PROP_MASTERNAME_DEFAULT = "master1"; // redis.sentinel.masterName的默认值
	public static final String REDIS_PROP_MAXATTEMPTS = "redis.maxAttempts";
	public static final int REDIS_PROP_MAXATTEMPTS_DEFAULT = 2; // redis.maxAttempts的默认值
	public static final String REDIS_PROP_POOL_MAXTOTAL = "redis.pool.maxtotal";
	public static final int REDIS_PROP_POOL_MAXTOTAL_DEFAULT = 20; // redis.pool.maxtotal的默认值
	public static final String REDIS_PROP_POOL_MAXIDLE = "redis.pool.maxIdle";
	public static final int REDIS_PROP_POOL_MAXIDLE_DEFAULT = 10; // redis.pool.maxIdle的默认值
	public static final String REDIS_PROP_POOL_MINIDLE = "redis.pool.minIdle";
	public static final int REDIS_PROP_POOL_MINIDLE_DEFAULT = 10; // redis.pool.minIdle的默认值
	public static final String REDIS_PROP_CONN_TIMEOUT = "redis.connectionTimeout";
	public static final int REDIS_PROP_CONN_TIMEOUT_DEFAULT = 100; // redis.connectionTimeout的默认值
	public static final String REDIS_PROP_SOTIMEOUT = "redis.soTimeout";
	public static final int REDIS_PROP_SOTIMEOUT_DEFAULT = 500; // redis.soTimeout的默认值
	public static final String REDIS_PROP_POOL_MAXWAIT_MILLIS = "redis.pool.maxWaitMillis";
	public static final int REDIS_PROP_POOL_MAXWAIT_MILLIS_DEFAULT = 2000; // redis.pool.maxWaitMillis的默认值
	public static final String REDIS_PROP_APPNAME = "redis.app";

	// 缓存
	public static final String CACHE_DEFAULT_PRE_NAME = REDIS_PROP_DEFAULT_PRE_NAME; // 默认的缓存配置name
	public static final String DEL_PERSISTENCE = "delPersistence";
	public static final String DEL_PERSISTENCE_INTERVAL = "delPersistenceInterval";
	public static final String DEL_PERSISTENCE_LEADER = "delPersistenceLeader";
	public static final int DEL_PERSISTENCE_TIME = 1; // 默认mongo里缓存一天
	public static final String CACHEPERSISTENCE_MONGO_TMP = "cachePersistence"; // 如果采用mongo缓存redis数据，这个是用于保存缓存redis数据的mongo连接在map里的key

	//zk配置信息
	public static final String ZK_PROP_LOCATION = "zookeeper.properties";
	public static final String ZK_PROP_SERVER = "zookeeper.server";
	public static final String ZK_PROP_TASK_SERVER = "task.zookeeper.server";
	public static final String ZK_SERVER_PRIFIX = "zookeeper://";
	public static final String ZK_PROP_APPNAME = "zookeeper.app";
	public static final String ZK_PROP_WORKIDNODENAME = "zookeeper.workIdname"; // workId在zk上对应的namespace
	public static final String DEFAULT_WORKIDNODENAME = "idgen_work"; // workId在zk上对应的默认namespace
	public static final String ZK_PROP_WORKIDMAXIDLEDAYS = "zookeeper.workIdidleseconds"; // 如果在zk上的wokId对应的节点有workIdidledays天没有被更新，就删除该节点
	public static final Integer DEFAULT_WORKIDMAXIDLESECONDS = 60 * 60 * 24 * 5; // 如果5天都没有更新时间，就认为该机器下线，在zk上删除该workId节点
	public static final String ZK_PROP_MAXWORKID = "zookeeper.maxWorkId"; // workId最大值
	public static final Long DEFAULT_MAXWORKID = 1000l; // workId最大值

	//分布式锁
	public static final String LOCK_DEFAULT_PRE_NAME = REDIS_PROP_DEFAULT_PRE_NAME; // 默认的分布式锁配置name
	public static final String LOCK_DEFAULT = "o2olock";

	//链路编排配置
	public static final String TRACE_SCHEDULE_LEADERNODENAME = "traceSchedule.leadername";
	public static final String TRACE_SCHEDULE_PROP_LOCATION = "traceshedule.properties";
	public static final String TRACE_SCHEDULE_TYPE = "traceScheduleType";
	public static final String TRACE_SCHEDULE_TYPE_DEFAULT = "traceScheduleMq";
	public static final String TRACE_SCHEDULE_MQ_NAME = "traceSchedule"; // 用于链路编排的默认mq集群名称
	public static final String TRACE_SCHEDULE_LAST_EXC = "traceScheduleLast"; // 消息编排链路的最后一个环节，可以调用一个方法，这是@MethodDispatcher的key，对应的参数是BusinessData

	//数据源配置
	public static final String DATASOURCE_LOCATION = "jdbc.properties";
	public static final String TRACE_SCHEDULE_DATASOURCE_PREFIX = "consistency";
	public static final String CONSISTENCY_TRANSACTION_DATASOURCE_PREFIX = TRACE_SCHEDULE_DATASOURCE_PREFIX;
	public static final String WORKFLOW_PREFIX = "workflow";
	public static final String EXCLUDESQLID = "excludeSqlId"; // 如果sql的if条件都没有匹配上，会记录警告，但这里配置的sqlid可以忽略警告
	public static final String DY_DATASOURCE_LOCATION = "dynamicDS.properties";
	public static final String DS_PROP_NAMES = "ds.names";
	public static final String DY_DATASOURCE_NAME = "dataSource"; // 动态数据源的ds的bean name
	public static final String DY_DEFAULTDATASOURCE_PREFIX = "defaultDsPrefix"; // 动态数据源的默认数据库配置信息的前缀
	public static final String DEFAULTDATASOURCE_PREFIX = "dsPrefix"; // 数据源的数据库配置信息的前缀
	public static final String SUPPORT_MYBATIS_PLUS = "mybatisPlus"; // 是否支持mybatis-plus
	public static final String MYBATIS_PLUS_METAOBJECTHANDLER = "mybatisPlusMetaObjectHandler"; // mybatis-plus的MetaObjectHandler
	public static final String MYBATIS_PLUS_INNERINTERCEPTORS = "mybatisPlusInnerInterceptors"; // mybatis-plus的InnerInterceptors
	public static final String BASE_PACKAGES = "basePackages";
	public static final String MAPPER_LOCATION = "mapperLocation";
	public static final String TYPE_ALIASES_PACKAGE = "typeAliasesPackage";
	public static final String DS_EXECUTION = "execution";

	//事务版本号，用于解决并发冲突
	public static final String CONSISTENCY_TRANSACTION_MAPPER_LOCATION = "com.duoduo.common.api.transaction.dao";
	//最终一致性
	public static final String CONSISTENCY_MAPPER_LOCATION = "com.duoduo.common.api.consistency.dao";
	public static final Byte CONSISTENCY_RETRY_NUM = 6; // 重试次数
	public static final int[] CONSISTENCY_RETRY_INTERVAL = new int[] {5, 90, 180, 1800, 3600, 7200}; // 重试时间间隔
	public static final String CONSISTENCY_DOMAIN_TRACE_SCHEDULE = "traceSchedule_consistency_event"; // traceSchedule的domain，用于业务补偿回调(消息编排用于最终一致性保障的业务标识)
	public static final String CONSISTENCY_DOMAIN_TRACE_MQ_SCHEDULE = "traceSchedule_consistency_mq_event"; // traceSchedule的domain，用于mq补偿回调(消息编排用于最终一致性保障的业务标识)
	public static final String CONSISTENCY_DOMAIN_DELAY_EXECUTE = "delayexecute_consistency_event"; // 延迟任务的domain，用于补偿回调(延迟任务用于最终一致性保障的业务标识)
	public static final Byte CONSISTENCY_LOCK_RETRY_TIMEOUT = 2; // 如果链路加锁，获取锁的超时时间
	public static final Integer CONSISTENCY_LOCK_EXPIRE_TIME = 10; // 如果链路加锁，锁的最长有效期
	public static final String CONSISTENCY_RETRY_ENABLED = "consistencyRetryEnable"; // 是否开启传输保障
	public static final boolean CONSISTENCY_RETRY_ENABLED_DEFAULT = true; // 是否开启传输保障
	public static final String CONSISTENCY_DOMAIN_HTTPCLIENT = "http_client_event"; // http调用的domain，用于补偿回调(http调用用于最终一致性保障的业务标识)
	public static final String CONSISTENCY_DOMAIN_DUBBOCLIENT = "dubbo_client_event"; // dubbo调用的domain，用于补偿回调(dubbo调用用于最终一致性保障的业务标识)
	public static final String CONSISTENCY_DOMAIN_METHODCLIENT = "method_client_event"; // method调用的domain，用于补偿回调(method调用用于最终一致性保障的业务标识)
	public static final String CONSISTENCY_DOMAIN_MQ = "mq_client_event"; // mq调用的domain，用于补偿回调(mq调用用于最终一致性保障的业务标识)
	public static final String DELETE_FINISH_LEADER = "delFinLeader"; // 定时删除finish表数据，只有一个leader做这个工作
	public static final byte DELETE_FINISH_BEFORE = -30; // 定时删除finish表数据，只保留30天
	public static final int DELETE_FINISH_BATCH = 3000; // 定时删除finish表数据，每次删除DELETE_FINISH_BATCH条
	public static final String SCAN_READY_LOCKAPP = "scanr"; // 扫描ready表时，加锁的appName
	public static final String ZOOKEEPER_LOCK = "zookeeper"; // 传输保障的加锁用zk实现
	// 自定义重试间隔
	public static final String RETRY_TRACESCHEDULE_INTERVALSECOND = "consistency.retry.traceSchedule.intervalSecond";
	public static final String RETRY_HTTPCLIENT_INTERVALSECOND = "consistency.retry.httpClient.intervalSecond";
	public static final String RETRY_DUBBOCLIENT_INTERVALSECOND = "consistency.retry.dubboClient.intervalSecond";
	public static final String RETRY_MQ_INTERVALSECOND = "consistency.retry.mq.intervalSecond";
	public static final String RETRY_METHOD_INTERVALSECOND = "consistency.retry.methodClient.intervalSecond";
	public static final String RETRY_DELAY_INTERVALSECOND = "consistency.retry.delay.intervalSecond";
	public static final Map<String, Integer[]> RETRY_INTERVALSECOND_MAP = new HashMap<>(8);

	//延迟消息实现方式
	public static final String DELAY_PROP_LOCATION = "distributedDelayExecute.properties"; // 配置文件位置
	public static final String DELAY_PROP_ENV = "env"; // 延迟任务环境前缀
	public static final String DELAY_PROP_TASKFLAG = "taskFlag"; // 任务标识: 用于区分不同的项目的任务
	public static final String DELAY_MNGTYPE = "delay.type";
	public static final String DELAY_MNGTYPE_DEFAULT = "redis";
	public static final String DELAY_JVM_MNGTYPE = "delay.jvm.type";
	public static final String DELAY_JVM_MNGTYPE_DEFAULT = "nettyHashedWheelTimer";
	public static final String CONSISTENCY_DELAY = "delayExecute"; // 延迟任务的传输保障里的bizKey
	public static final Byte DELAY_CONSISTENCY_START_RETRY_NUM = 1; // 延迟任务的传输保障起始重试次数
	public static final String DELAY_MESSAGE_STORE_QUEUENAME = "delayMessageStoreQueue"; // 延迟任务最终执行的mq消息的前缀
	public static final int DELAY_REDIS_TIME = 60 * 10; // 延迟任务插入后，任务对象在redis的延长有效期

	//mq
	public static final String CONSUMER_EXECUTE_BEFORE = "consumer_execute_before_event"; // mq消费者消费数据前的事件
	public static final String CONSUMER_EXECUTE_AFTER = "consumer_execute_after_event"; // mq消费者消费数据后的事件
	public static final String PRODUCER_POOL_MINTHREADNUM = "producer.pool.minThreadNum"; // 发送者线程池最小核心数
	public static final String PRODUCER_POOL_SPRING_BEANNANE_PRIFIX = "producer.pool."; // 发送者线程池在spring里的bean name前缀
	public static final String PRODUCER_POOL_MAXTHREADNUM = "producer.pool.maxThreadNum"; // 发送者线程池最大核心数
	public static final String PRODUCER_POOL_KEEPALIVESECOND = "producer.pool.keepAliveSecond"; // 最大空闲存活时间
	public static final int PRODUCER_POOL_MINTHREADNUM_DEFAULT = Runtime.getRuntime().availableProcessors() + 1; // 发送者线程池最小核心数默认值
	public static final int PRODUCER_POOL_MAXTHREADNUM_DEFAULT = Runtime.getRuntime().availableProcessors() + 1; // 发送者线程池最大核心数默认值
	public static final int PRODUCER_POOL_KEEPALIVESECOND_DEFAULT = 60; // 最大空闲存活时间默认值
	public static final String MQ_LEADERNODENAME = "mq.leadername"; // mq zk选举
	public static final String MQ_CONSISTENCYFLAG = PropertiesInnerUtil.getString(Constant.ZK_PROP_LOCATION, Constant.MQ_LEADERNODENAME);
	public static final String MQ_TRANS_ID = "trans_id"; // 配合idempotent功能

	//Handlers
	public static final String HANDLER_EXECUTE_AFTER = "handler_execute_after_event"; // Handlers注解的类里的方法执行后的事件
	public static final String HANDLER_EXECUTE_EXCEPTION = "handler_execute_exception_event"; // Handlers注解的类里的方法执行后的异常事件

	//方法分发
	public static final String METHOD_DISPATCHER_MAP_KEY = "methodDispatcherMapKey"; // 初始化好的方法对象map缓存在map中的key

	//id生成器
	public static final String UIDGENERATOR_JVM = "jvm"; // jvm内部唯一id的spi实现标识
	public static final String UIDGENERATOR_DISTRIBUTE = "distribute"; // 全局内部唯一id的spi实现标识
	public static final String UIDGENERATOR_DATASOURCE_PREFIX = "distributed.idgenerator";
	public static final String UIDGENERATOR_MAPPER_LOCATION = "com.duoduo.common.uid.worker.dao";
	public static final String UIDGENERATOR_PROP_LOCATION = "uidgenerator.properties";
	public static final String UIDGENERATOR_PROP_TIMEBITS = "timeBits";
	public static final String UIDGENERATOR_PROP_WORKBITS = "workerBits";
	public static final String UIDGENERATOR_PROP_SEQBITS = "seqBits";
	public static final Integer DEFAULT_TIMEBITS = 28;
	public static final Integer DEFAULT_WORKBITS = 22;
	public static final Integer DEFAULT_SEQBITS = 13;

	public static final int SNAKE_DEFAULT_WORKID = 7; // 雪花算法默认机器id

	// 链路追踪
	public static final String TRACER_BEANNAME = "selfSofaTracer"; // 用于判断是否开启的beanName
	public static final String TRACER_MQ_CLIENT_NAME = "clientTracer"; // mq的生产者实现
	public static final String TRACER_MQ_SERVER_NAME = "serverTracer"; // mq的消费者实现
	public static final String TRACER_ASYNC_CLIENT_NAME = "asyncClientTracer"; // 异步调用者实现
	public static final String TRACER_ASYNC_SERVER_NAME = "asyncServerTracer"; // 异步被调用者实现
	public static final String TRACER_SQL_CLIENT_NAME = "sqlClientTracer"; // sql调用者实现
	public static final String TRACER_REDIS_CLIENT_NAME = "redisClientTracer"; // redis调用者实现
	public static final String TRACER_ES_CLIENT_NAME = "esClientTracer"; // es调用者实现
	public static final String TRACER_MONGO_CLIENT_NAME = "mongoClientTracer"; // mongo调用者实现

	public static final String TRACER_REPORTER_TYPE = "tracer.reporter.type"; // reporter实现类型
	public static final String TRACER_REPORTER_LOG_TYPE = "tracerReporterLogType"; // reporter实现类型
	public static final String TRACER_REPORTER_LOG_TYPE_DEFAULT = "log"; // reporter实现类型
	public static final String TRACER_DATASOURCE_PREFIX = "tracer"; // 用于保存链路数据的数据库配置信息的前缀
	public static final String TRACER_MAPPER_LOCATION = "com.duoduo.common.tracer.worker.dao";
	public static final String REPORTER_TYPE_MYSQL = "mysql";
	public static final String REPORTER_TYPE_MONGO = "mongo";
	public static final String SOFATRACERSPANCONTEXT_KEY = "sofaTracerSpanContext";
	public static final int REPORTER_QUEUE_CAP = 5000; // reporter队列容量
	public static final int REPORTER_BATCH = 100; // 每批入库的reporter条数
	public static final String DELETE_TRACER_LEADER = "delTraLeader"; // 定时删除链路表数据，只有一个leader做这个工作
	public static final String REPORTER_TYPE_MONGO_TMP = "tracer"; // 如果采用mongo保存，这个是用于保存链路数据的mongo连接在map里的key
	public static final int DELETE_TRACER_BATCH = 10000; // 定时删除链路表数据，每次删除DELETE_TRACER_BATCH条

	// 线程池
	public static final int DEFAULT_KEEPALIVE_SECONDS = 60;
	public static final String ASYNC_ANNO_DEFAULT_POOL_BEANNAME = "tracerAsyncThreadPool"; // @Async注解使用的默认线程池的beanName;
	public static final String RETRY_DEFAULT_POOL_BEANNAME = "retryAsyncThreadPool"; // @Retry注解使用的默认线程池的beanName

	// es配置
	public static final String ES_PROP_LOCATION = "elasticsearch.properties";
	public static final String ES_PROP_CLUSTER_ADDRESS = "es.addresses"; // 集群地址
	public static final String ES_PROP_CONNECTTIMEOUT = "es.connectTimeout"; // 连接超时时间
	public static final int ES_PROP_CONNECTTIMEOUT_DEFAULT = 1000;
	public static final String ES_PROP_CONNECTIONREQUESTTIMEOUT = "es.connectionRequestTimeout"; // 获取连接的超时时间
	public static final int ES_PROP_CONNECTIONREQUESTTIMEOUT_DEFAULT = 1000;
	public static final String ES_PROP_SOCKETTIMEOUT = "es.socketTimeout"; // Socket连接超时时间
	public static final int ES_PROP_SOCKETTIMEOUT_DEFAULT = 10000;
	public static final String ES_PROP_MAXCONNECTNUM = "es.maxConnectNum"; // 最大连接数
	public static final int ES_PROP_MAXCONNECTNUM_DEFAULT = 50;
	public static final String ES_PROP_MAXCONNECTPERROUTE = "es.maxConnectPerRoute"; // 最大路由连接数
	public static final int ES_PROP_MAXCONNECTPERROUTE_DEFAULT = 10;
	public static final String DEFAULT_ANALYZER = "ik_max_word"; // 默认分词器
	public static final String APP_LOADER_PATH = File.separator + "app" + File.separator + "lib" + File.separator;
	public static final String ES6_LOADER_PATH = "es6" + File.separator + "lib"; // es6 loader加载方式的目录
	public static final String MEDUSA_ELASTICSEARCH = "medusa-elasticsearch"; // es6 jar文件名
	public static final String ESVERSIONCONFLICT_KEY = "version_conflict_engine_exception"; // 版本冲突异常关键字
	public static final String ESUPDATENOEXIST_KEY = "document_missing_exception"; // 记录不存在异常关键字
	public static final String ES_REFRESHPOLICY = "true"; // 请求向ElasticSearch提交了数据，立即进行数据刷新，然后再结束请求
	public static final int ES_LIST_MAXCOUNT = 10000; // 一次list查询最多返回的数据条数

	// MongoDB配置
	public static final String MONGO_PROP_DEFAULT_PREFIX = "mongo.";
	public static final String MONGO_PROP_LOCATION = "mongo.properties";
	public static final String MONGO_PROP_CLUSTER_TYPE = "clusterType"; // 集群类型
	public static final String MONGO_PROP_CLUSTER_TYPE_DEFAULT = "replica"; // 默认集群类型为 主从复制
	public static final String MONGO_PROP_REPLICA_READ_DB_URL = "replica.read.url"; // 从库地址
	public static final String MONGO_PROP_REPLICA_WRITE_DB_URL = "replica.write.url"; // 主库地址
	public static final String MONGO_PROP_DB_NAME = "dbName"; // 数据库名称
	public static final String MONGO_PROP_MINPOOLSIZE = "minPoolSize"; // 链接池数量
	public static final int MONGO_PROP_MINPOOLSIZE_DEFAULT = 10; // 链接池数量
	public static final String MONGO_PROP_MAXPOOLSIZE = "maxPoolSize"; // 链接池数量
	public static final int MONGO_PROP_MAXPOOLSIZE_DEFAULT = 20; // 链接池数量
	public static final String MONGO_PROP_CONNECTTIMEOUTMS = "connectTimeoutMS"; // 连接超时时间
	public static final String MONGO_PROP_SOCKETTIMEOUTMS = "socketTimeoutMS"; // 读写超时时间
	public static final String MONGO_PROP_MAXIDLETIMEMS = "maxIdleTimeMS"; // 最大空闲时间
	public static final String MONGO_PROP_MAXLIFETIMEMS = "maxLifeTimeMS"; // 连接最大生命周期

	// httpClient
	public static final String CLIENT_LOCATION = "clientLocation";
	public static final String CLIENT_RETRY = "retry"; // httpclient调用是否支持重试
	public static final String CLIENT_SECURITY = "security"; // httpclient调用是否需要账户信息，安全访问
	public static final String CLIENT_TOKEN = "clienttoken"; // httpclient调用需要账户信息，生成的token
	public static final String CLIENT_NEED_SECURITY = "true"; // httpclient调用需要账户信息，安全访问
	public static final String CLIENT_SECURITY_LOCATION = "clientsecurity.properties"; // httpclient调用的用户信息配置文件
	public static final String CLIENT_SECURITY_NAME = PropertiesInnerUtil.getString(Constant.CLIENT_SECURITY_LOCATION, "username"); // httpclient调用的账户
	public static final String CLIENT_SECURITY_PASS = PropertiesInnerUtil.getString(Constant.CLIENT_SECURITY_LOCATION, "password"); // httpclient调用的密码
	public static final String CLIENT_SECURITY_KEY = PropertiesInnerUtil.getString(Constant.CLIENT_SECURITY_LOCATION, "key"); // httpclient调用的加密key
	public static final Byte CLIENT_RETRY_CONSISTENCY_START_RETRY_NUM = 1; // http调用的传输保障起始重试次数
	public static final String HTTPCLIENT_LEADERNODENAME = "httpClient.leadername"; // http client zk选举
	public static final String HTTP_PROCOL = "http://"; // http协议
	public static final String NACOSSERVERADDR = "spring.cloud.nacos.discovery.server-addr"; // nacos服务地址
	public static final String NACOSNAMESPACE = "spring.cloud.nacos.discovery.namespace"; // nacos服务名
	// dubbo
	public static final String DUBBOCLIENT_LEADERNODENAME = "dubboClient.leadername"; // dubbo client zk选举
	public static final String DUBBO_PROXY = "duoduojavassist"; // 自定义的dubbo proxy
	// method
	public static final String METHODCLIENT_LEADERNODENAME = "methodClient.leadername"; // method client zk选举

	// 配置中心
	public static final String duoduo_APOLLO_CLASSNAME = "com.duoduo.framework.apollo.Config"; // apollo的类路径
	public static final String APOLLO_CLASSNAME = "com.ctrip.framework.apollo.Config"; // apollo的类路径
	public static final String APOLLO = "apollo"; // apollo

	// 熔断限流
	public static final String GUARD_CONFIGCENTER_PREFIX = "guardconfig."; // 在配置中心的key后缀

	// task
	// sia
	public static final String SIA_TASK_ZOOKEEPER_HOST = "zooKeeperHosts"; // sia task Zookeeper server
	public static final String SIA_TASK = "sia"; // sia 定时任务的实现key，标识使用的实现是sia
	// simple task
	public static final String SIMPLE_TASK = "uncode"; // 简单的定时任务的实现key
	public static final int SIMPLE_TASK_DEFAULT_POOL_SIZE = 20; // 简单的定时任务的默认pool大小
	public static final String SIMPLE_TASK_PREFIX = "task.uncode.schedule"; // application.yml属性前缀
	public static final String DEFAULT_SIMPLE_TASK_START_SCHEDULE = "true"; // 是否启动调度管理，如果只是做系统管理，应该设置为false
	public static final int DEFAULT_SIMPLE_TASK_ZKSESSIONTIMEOUT = 60000; // 简单的定时任务的zk默认session超时时间
	public static final String DEFAULT_SIMPLE_TASK_ROOTPATH = "/uncode/schedule"; // 简单的定时任务的zk rootPath
	public static final int SIMPLE_TASK_ZKCONN_NUM = 10; // 简单的定时任务的zk连接重试次数
	public static final int SIMPLE_SERVER_EXPIRE_TIME = 15000; // 简单的定时任务的server过期时间，即多久没有更新zk节点
	public static final int SIMPLE_TIMERINTERVAL = 1000; // 简单的定时任务的server心跳时间间隔，即多久更新一次zk节点
	public static final int SIMPLE_TIMERINTERVAL_DELAY = 1000; // 简单的定时任务的server心跳开始延迟时间
	public static final String SIMPLE_TASK_SERVLET = "scheduleManager"; // simple task的管理servlet名称
	public static final String SIMPLE_TASK_SERVLET2 = "scheduleManager2"; // simple task的管理servlet名称
	public static final String SIMPLE_TASK_SERVLET_MAPPING = "/uncode/schedule"; // simple task的servlet映射
	public static final String SIMPLE_TASK_SERVLET_MAPPING2 = "/uncode/schedule2"; // simple task的servlet映射
	public static final String EMBEDDED_WEB = "embeddedWeb"; // 嵌入式web环境
	public static final String SIMPLE_TASK_SERVLET_PATH = "org.duoduo.common.task.web"; // servlet地址
	public static final String ASYNCTASKEXECUTORNAME = "subTaskExecutor"; // 子任务的执行线程池名称
	public static final int ASYNCTASKEXECUTOR_MAX = 100; // 子任务的执行线程池的最大线程数
	public static final String TSAK_STATUS = "status"; // 状态节点

	public static final String OTHER_CONFIG = "otherConfig"; // 手动往spring容器里放入的配置
	public static final String OTHERBOOTSTRAPPROPERTYSOURCES = "otherBootstrapPropertySources"; // 手动往spring容器里放入的配置
	public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
	public static final String DEFAULT_SHORT_DATE_FORMAT = "yyyy-MM-dd";
	public static final String DEFAULT_LONG_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";

	// workflow
	public static final String ACTIVITY_ID = "activityId";
	public static final String WORKFLOWUTIL_BEANNAME = "workflowUtil"; // workflowUtil的beanName
	public static final String BUSSINESS_SPEND_TIME = "spend";
	public static final String PROCESS_DEFINITION_KEY = "processDefinitionKey";
	public static final int DEFAULT_THREAD_TIMEOUT = 2; // 并行线程的默认超时时间
	public static final String WORKFLOW_GRAYRELEASED_PERCENT = "workflow.grayReleased.percent"; // 灰度发布的百分比在配置中心的key
	public static final String DEFAULT_WORKFLOW_GRAYRELEASED_PERCENT = "80"; // 灰度发布的百分比的默认值
	public static final int DEFAULT_WORKFLOW_GRAYRELEASED_PERCENT_INT = 80; // 灰度发布的百分比的默认值
	public static final String WORKFLOWBUSINESSEXCEPTION_KEY = "ex"; // WorkflowBusinessException异常对应的map的key
	public static final String PROCESSINSTANCEID_KEY = "procinstId"; // ProcessInstanceId对应的map的key

	public static final String DYSQLIFMATCH = "DySqlIfMatch"; // 记录每次查询时，mybatis的if是否匹配过

	// 异步
	public static final String ENABLE_ASYNC_ANNO_ATTR = "AsyncAnnoAttr";

	// json
	// 在json反解析时，如果属性值为空集合（空list或空map），则直接解析为null（这是用来兼容crm api返回值异常的问题）
	public static final Map<Type, String> EMPTYVALUETONULL_MAP = new ConcurrentHashMap<>();
}
